package service;

import com.root.health.bean.ElderhealthInfo;
import com.root.health.mapper.HealthInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

@Service

public class HealthInfoService {
    @Autowired
    HealthInfoMapper healthInfoMapper;
    public void elderHealthInfo(long height, long weight, long systolicPressure, long diastolicPressure, double temperature, double glucose, long heartbeat, long elderuserid, Timestamp healthdate){
        healthInfoMapper.health(height,weight,systolicPressure,diastolicPressure,temperature,glucose,heartbeat,elderuserid,healthdate);
    }//添加用户基本健康信息
    public List<ElderhealthInfo> healthByid(long userid){
        return healthInfoMapper.healthByid(userid);
    }//根据用户id查询用户基本健康信息
    public Integer healthByDate(Timestamp healthDate) {
        return healthInfoMapper.healthByDate(healthDate);
    }//根据时间戳校验用户信息是否存在
    public void healthDel(long healthid){
        healthInfoMapper.healthDel(healthid);
    }//根据用户id删除用户基本健康信息
    public void healthUpd(long healthid,long height, long weight, long systolicPressure, long diastolicPressure, double temperature,double glucose, long heartbeat){
        healthInfoMapper.healthUpd(healthid,height,weight,systolicPressure,diastolicPressure,temperature,glucose,heartbeat);
    }//根据健康信息id修改用户基本健康信息

}
